<template>
  <div class="content">
    <el-table :data="logs" border>
      <el-table-column prop="username" label="登入账户" align="center"> </el-table-column>
      <el-table-column prop="lastLogin.ip" label="上次登入ip" align="center"> </el-table-column>
      <el-table-column prop="lastLogin.loginTime" label="上次登入时间" align="center" sortable> </el-table-column>
      <el-table-column prop="nowLogin.ip" label="本次登入ip" align="center"> </el-table-column>
      <el-table-column prop="nowLogin.loginTime" label="本次登入时间" align="center"> </el-table-column>
    </el-table>
  </div>
</template>

<script>
import * as api from "../../../api/index";
export default {
  data() {
    return {
      logs: []      
    };
  },
  created() {
    api.getLoginlog().then((res) => {
        this.logs = res.data.data;
      console.log(res);
    });
  },
  methods: {
      formatter(row, column) {
        return row.address;
      }
    }
};
</script>
<style>
.content {
  width: 100%;
  height: 100%;
  margin-top: 10px;
}
</style>